package com.javatest.springboot2basictest;

import com.javatest.springboot2basictest.config.BeanConfig;
import com.javatest.springboot2basictest.service.TestService;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.EnableAspectJAutoProxy;

@EnableAspectJAutoProxy
@SpringBootApplication
public class Springboot2BasictestApplication {

    public static void main(String[] args) {
//        SpringApplication.run(Springboot2BasictestApplication.class, args);
        /*ApplicationContext context = new AnnotationConfigApplicationContext(ImportBeanConfig.class);
        final Circle bean = context.getBean(Circle.class);
        bean.sayHi();
        final Triangle triangle = context.getBean(Triangle.class);
        triangle.sayHi();
        final Rectangle rectangle = context.getBean(Rectangle.class);
        rectangle.sayHi();*/

        /*ApplicationContext context = new AnnotationConfigApplicationContext(ConditionConfig.class);
        final ConditionBean bean = context.getBean(ConditionBean.class);
        bean.sayHi();*/

        ApplicationContext context = new AnnotationConfigApplicationContext(BeanConfig.class);
        final TestService bean = context.getBean(TestService.class);
        bean.test();
    }

}
